<?php

class m120429_051756_create_page extends CDbMigration {

	public function safeUp() {
		$page = array(
			'id'=>'pk',
			'chapterId'=>'integer',
			'sequence'=>'integer',
			'subSequence'=>'varchar(1)',
			'createdAt'=>'datetime',
			'updatedAt'=>'datetime',
		);
		$this->createTable('pages', $page);
		$this->createIndex('index_page_chapter', 'pages', 'chapterId');
		$this->createIndex('index_page_updated_at', 'pages', 'updatedAt');
	}

	public function safeDown() {
		$this->dropTable('pages');
	}

}